import {getData, sendData} from "./http";

//热门作品展示
export const selectHotWorks = (data) => getData('/webserver/worksInfo/selectHotWorksInfo', data);

//最新作品展示
export const selectNewWorks = (data) => getData('/webserver/worksInfo/selectNewWorksInfo', data);

//用户的作品
export const selectUserWorks = (data) => sendData(`/webserver/worksInfo/selectWorksInfoByUser`, data);

//作品详情
export const getWorkInfoById = (data) => sendData(`/webserver/worksInfo/getWorkInfoById`, data);

//作品评论
export const getWorkComment = data => sendData(`/webserver/worksInfo/getWorkComment`, data);

//添加评论
export const addWorkComment = (data) => sendData(`/webserver/worksInfo/addWorkComment`, data);

//作品搜索
export const getWorkInfoByKeyWord = (type, data) => sendData(`/webserver/worksInfo/getWorkInfoByKeyWord?type=${type}`, data);

//分类查询
export const searchWorksInfoByCategory = (type, data) => sendData(`/webserver/worksInfo/searchWorksInfoByCategory?type=${type}`, data);

export const addWork = (data) => sendData(`/webserver/worksInfo/uploadFile`, data);

export const uploadPoster = (data) => sendData(`/webserver/worksInfo/uploadPoster`, data);
export const uploadWorkFile = (data) => sendData(`/webserver/worksInfo/uploadWorkFile`, data);
export const deleteWorkById = (data) => sendData(`/webserver/worksInfo/deleteWorkById`, data);
